label: we can't ignore sizes on ellipsized labels
authorBenjamin Otte <otte@redhat.com>
Sun, 3 Apr 2011 13:03:19 +0000 (15:03 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 14 Apr 2011 12:59:24 +0000 (14:59 +0200)
So don't use this optimization when a label is ellipsized.

https://bugzilla.gnome.org/show_bug.cgi?id=646517

gtk/gtklabel.c

index 72e4eb073a0a17a7d120ef5e9e8899f893dfc8fe..04bf4ffb39c8474f8d64b94d82c960d50bd80392 100644 (file)
@@ -3077,12 +3077,14 @@ gtk_label_get_measuring_layout (GtkLabel *   label,
     }
 
   /* oftentimes we want to measure a width that is far wider than the current width,
-   * even though the layout is not wrapped. In that case, we can just return the
-   * current layout, because for measuring purposes, it will be identical.
+   * even though the layout would not change if we made it wider. In that case, we
+   * can just return the current layout, because for measuring purposes, it will be
+   * identical.
    */
   pango_layout_get_extents (priv->layout, NULL, &rect);
   if ((width == -1 || rect.width <= width) &&
-      !pango_layout_is_wrapped (priv->layout))
+      !pango_layout_is_wrapped (priv->layout) &&
+      !pango_layout_is_ellipsized (priv->layout))
     {
       g_object_ref (priv->layout);
       return priv->layout;